<script type="text/javascript">
	bkLib.onDomLoaded(function() {
		new nicEditor({iconsPath : '<?php echo $admin_js_path; ?>nicEditorIcons.gif',maxHeight:550 }).panelInstance('description_en');
		new nicEditor({iconsPath : '<?php echo $admin_js_path; ?>nicEditorIcons.gif',maxHeight:550 }).panelInstance('description_ar');
	});
</script> 	
<div style="padding:30px;">
  <?php if(!empty($id)) { ?>
 <form action="<?= $admin_base_url; ?>pages/edit/<?=$id;?>/<?php echo $cur_page;?>" method="post" id="page_form">
 <?php } else { ?>
 <form action="<?= $admin_base_url; ?>pages/add/<?= $cur_page;?>" method="post" id="page_form">
 <?php } ?>
 
        <label>  Tilte </label>
		<input class="txt1" type="text" name="name" value="<?php echo $page['name'];?>" /></br>
   
    
		<label> Content </label>
		<br/><br/>
        <textarea name="content" id="description_en" style="width: 700px; height: 200px;" ><?php echo $page['content'];?></textarea>
		<br/>

    
		<br/>
        <?php
	
			echo "<label>  Filename  </label>";
			echo $page['filename'];
			echo "<br/><br/>";
			
			?>
		<!--	<input class="txt1" id="f_dob" type="hidden" name="filename_en" value="<?php echo $page['filename_en'];?>"/><br/>
			<input class="txt1" id="f_dob" type="hidden" name="filename_ar" value="<?php echo $page['filename_ar'];?>"/><br/> -->
            <?php
		
		?>

	 
        <?php
	
		?>
        
        <script type="text/javascript">
//<![CDATA[
Calendar.setup({
inputField : "f_dob",
trigger : "f_dob_button",
onSelect : function() { this.hide() },
showTime : 12,
dateFormat : "%Y-%m-%d"
});
//]]>
</script>
		<label>&nbsp;</label>
		   
			<div class="buttons">
			    <button type="submit" name="save" class="positive" value="save" >
			        <img src="<?php echo $admin_image_path?>icons/apply.png" alt=""/>
			          <?php if(!empty($id)) { 
					  ?>
 						    Update page
                        
 							<input type="hidden" name="id" value="<?php echo $id;?>" />
                       
 							<input  type="hidden" name="rurl" value="<?php echo $rurl;?>" />
 					  <?php } else {
						  ?> 
 					  	 Add page
                         <?php
 					  	 } ?>

 			    </button>
			   <a href="<?= $admin_base_url; ?>pages/cancel?rurl=<?php echo $rurl;?>" class="negative">
			        <img src="<?php echo $admin_image_path?>icons/cross.png" alt=""/>
			        Cancel
			   </a>
			</div>
		


 </form>
 </div>
 <script type="text/javascript">//<![CDATA[
      Calendar.setup({
        inputField : "f_dob",
        trigger    : "f_dob_button",
        onSelect   : function() { this.hide() },
        showTime   : 12,
        dateFormat : "%Y-%m-%d"
      });
    //]]></script>
 <script>
 $(document).ready(function() {
     $("#staff_form").RSV({
       onCompleteHandler: frmSubmit,
       errorFieldClass: "errorDesc",
       displayType: "display-html",
       errorHTMLItemBullet: "&#8212; ",
             rules: [
                     "required,first_name,Please enter name.",
					 "required,staff_code,Please enter staff code.",
					 "required,dob,Please enter date of birth."
             ]
     });
  // a custom onComplete handler to prevent form submits for the demo
     function frmSubmit()
     {
       return true;
     }

        
});
 </script>